export class FormBase<T>{
    value: T;
    key: string;
    label: string;
    required: boolean;
    order: number;
    addOnAfter: boolean;
    controlType: string;
    marginLeft: number;

    constructor(
        options: {
            value?: T,
            key?: string,
            label?: string,
            required?: boolean,
            order?: number,
            addOnAfter?: boolean,
            controlType?: string,
            marginLeft?: number
        } = {}
    ) {
        this.value = options.value;
        this.key = options.key || '';
        this.label = options.label || '';
        this.required = !!options.required;
        this.addOnAfter = options.addOnAfter || false;
        this.order = options.order === undefined ? 1 : options.order;
        this.controlType = options.controlType || '';
        this.marginLeft = options.marginLeft || 0;
    }
}
